package com.bc.bczbweb.controller;

import com.bc.commoncore.util.StringUtils;
import com.bc.commonentity.common.JsonResult;
import com.bc.bcapi.service.T_Wallet_infoService;
import com.bc.bcmodel.domain.T_Wallet_infoModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.math.BigInteger;

import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("t_wallet_info")
public class T_Wallet_infoController extends BaseController {
    @Autowired
    T_Wallet_infoService t_Wallet_infoService;

    @RequestMapping("list")
    public ModelAndView list() {
        ModelAndView view = super.baseView("列表", "t_wallet_info/list");
        return view;
    }

    @RequestMapping(value = "listdo", method = RequestMethod.POST)
    public ModelAndView listdo(T_Wallet_infoModel req) {
        ModelAndView view = super.baseViewAjax("列表", "t_wallet_info/listdo");
        view.addObject("data", null);
        return view;
    }

    @RequestMapping("add")
    public ModelAndView add(BigInteger id) {
        String title = id.intValue() > 0 ? "编辑" : "添加";
        ModelAndView view = super.baseView(title, "t_wallet_info/add");
        T_Wallet_infoModel model = new T_Wallet_infoModel();
        model.setId(id);
        T_Wallet_infoModel data = t_Wallet_infoService.findByNamedParam(model);
        view.addObject("data", data);
        view.addObject("title", title);
        return view;
    }
}